using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeostatisticalAnalystTools._SamplingNetworkDesign
{
    /// <summary>
    /// <para>Densify Sampling Network</para>
    /// <para>Uses a predefined geostatistical kriging layer to determine where new monitoring stations should be built.  It can also be used to determine which monitoring stations should be removed from an existing network.</para>
    /// <para>使用预定义的地统计克里金图层来确定应在何处构建新的监测站。 它还可用于确定应从现有网络中删除哪些监控站。</para>
    /// </summary>    
    [DisplayName("Densify Sampling Network")]
    public class DensifySamplingNetwork : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DensifySamplingNetwork()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_geostat_layer">
        /// <para>Input geostatistical layer</para>
        /// <para>Input a geostatistical layer resulting from a Kriging model.</para>
        /// <para>输入由克里金模型生成的地统计图层。</para>
        /// </param>
        /// <param name="_number_output_points">
        /// <para>Number of  output points</para>
        /// <para>Specify how many sample locations to generate.</para>
        /// <para>指定要生成的采样位置数。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output point feature class</para>
        /// <para>The name of the output feature class.</para>
        /// <para>输出要素类的名称。</para>
        /// </param>
        public DensifySamplingNetwork(object _in_geostat_layer, long? _number_output_points, object _out_feature_class)
        {
            this._in_geostat_layer = _in_geostat_layer;
            this._number_output_points = _number_output_points;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Geostatistical Analyst Tools";

        public override string ToolName => "Densify Sampling Network";

        public override string CallName => "ga.DensifySamplingNetwork";

        public override List<string> AcceptEnvironments => ["extent", "geographicTransformations", "outputCoordinateSystem", "parallelProcessingFactor", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_geostat_layer, _number_output_points, _out_feature_class, _selection_criteria.GetGPValue(), _threshold, _in_weight_raster, _in_candidate_point_features, _inhibition_distance];

        /// <summary>
        /// <para>Input geostatistical layer</para>
        /// <para>Input a geostatistical layer resulting from a Kriging model.</para>
        /// <para>输入由克里金模型生成的地统计图层。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input geostatistical layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_geostat_layer { get; set; }


        /// <summary>
        /// <para>Number of  output points</para>
        /// <para>Specify how many sample locations to generate.</para>
        /// <para>指定要生成的采样位置数。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of  output points")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public long? _number_output_points { get; set; }


        /// <summary>
        /// <para>Output point feature class</para>
        /// <para>The name of the output feature class.</para>
        /// <para>输出要素类的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output point feature class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Selection criteria</para>
        /// <para><xdoc>
        ///   <para>Methods to densify a sampling network.</para>
        ///   <bulletList>
        ///     <bullet_item>Standard error of prediction—Standard error of prediction criteria</bullet_item><para/>
        ///     <bullet_item>Standard error threshold—Standard error threshold criteria</bullet_item><para/>
        ///     <bullet_item>Lower quartile threshold— Lower quartile threshold criteria</bullet_item><para/>
        ///     <bullet_item>Upper quartile threshold— Upper quartile threshold criteria</bullet_item><para/>
        ///   </bulletList>
        ///   <para>The Standard error of prediction option will give extra weight to locations where the standard error of prediction is large. The Standard error threshold, Lower quartile threshold, and Upper quartile threshold options are useful when there is a critical threshold value for the variable under study (such as the highest admissible ozone level). The Standard error threshold option will give extra weight to locations whose values are close to the threshold. The Lower quartile threshold option will give extra weight to locations that are least likely to exceed the critical threshold. The Upper quartile threshold option will give extra weight to locations that are most likely to exceed the critical threshold.</para>
        ///   <para>When the Selection criteria is set to Standard error threshold, Lower quartile threshold, or Upper quartile threshold, the Threshold value parameter will become available, allowing you specify your threshold of interest.</para>
        ///   <para>The equations for each option are:
        ///   <code>Standard error of prediction = stderr Standard error threshold = stderr(s)(1 - 2 · abs(prob[Z(s) > threshold] - 0.5)) Lower quartile threshold = (Z0.75(s) - Z0.25(s)) · (prob[Z(s) < threshold]) Upper quartile threshold = (Z0.75(s) - Z0.25(s)) · (prob[Z(s) > threshold])</code>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>对采样网络致密化的方法。</para>
        ///   <bulletList>
        ///     <bullet_item>预测标准误差 - 预测标准的标准误差</bullet_item><para/>
        ///     <bullet_item>标准错误阈值 - 标准错误阈值条件</bullet_item><para/>
        ///     <bullet_item>下四分位数阈值 — 下四分位数阈值标准</bullet_item><para/>
        ///     <bullet_item>Upper quartile threshold— 上四分位数阈值标准</bullet_item><para/>
        ///   </bulletList>
        ///   <para>预测标准误差选项将为预测标准误差较大的位置提供额外的权重。当所研究的变量存在临界阈值（例如最高允许臭氧水平）时，标准误差阈值、下四分位数阈值和上四分位数阈值选项非常有用。标准误差阈值选项将为值接近阈值的位置提供额外的权重。下四分位数阈值选项将为最不可能超过临界阈值的位置提供额外的权重。“上四分位数阈值”选项将为最有可能超过临界阈值的位置提供额外的权重。</para>
        ///   <para>当“选择条件”设置为“标准误差阈值”、“下四分位数阈值”或“上四分位数阈值”时，阈值参数将变为可用，允许您指定感兴趣的阈值。</para>
        /// <para>每个选项的公式为：
        /// <code>预测的标准误差 = stderr 标准误差阈值 = stderr（s）（1 - 2 · abs（prob[Z（s） > 阈值] - 0.5）） 四分位数下限阈值 = （Z0.75（s） - Z0.25（s）） ·（prob[Z（s） <阈值]）上四分位数阈值 = （Z0.75（s） - Z0.25（s）） ·（prob[Z（s） >阈值]）</code>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Selection criteria")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _selection_criteria_value _selection_criteria { get; set; } = _selection_criteria_value._STDERR;

        public enum _selection_criteria_value
        {
            /// <summary>
            /// <para>Standard error of prediction</para>
            /// <para>Standard error of prediction—Standard error of prediction criteria</para>
            /// <para>预测标准误差 - 预测标准的标准误差</para>
            /// </summary>
            [Description("Standard error of prediction")]
            [GPEnumValue("STDERR")]
            _STDERR,

            /// <summary>
            /// <para>Standard error threshold</para>
            /// <para>Standard error threshold—Standard error threshold criteria</para>
            /// <para>标准错误阈值 - 标准错误阈值条件</para>
            /// </summary>
            [Description("Standard error threshold")]
            [GPEnumValue("STDERR_THRESHOLD")]
            _STDERR_THRESHOLD,

            /// <summary>
            /// <para>Lower quartile threshold</para>
            /// <para>Lower quartile threshold— Lower quartile threshold criteria</para>
            /// <para>下四分位数阈值 — 下四分位数阈值标准</para>
            /// </summary>
            [Description("Lower quartile threshold")]
            [GPEnumValue("QUARTILE_THRESHOLD")]
            _QUARTILE_THRESHOLD,

            /// <summary>
            /// <para>Upper quartile threshold</para>
            /// <para>Upper quartile threshold— Upper quartile threshold criteria</para>
            /// <para>Upper quartile threshold— 上四分位数阈值标准</para>
            /// </summary>
            [Description("Upper quartile threshold")]
            [GPEnumValue("QUARTILE_THRESHOLD_UPPER")]
            _QUARTILE_THRESHOLD_UPPER,

        }

        /// <summary>
        /// <para>Threshold value</para>
        /// <para><xdoc>
        ///   <para>The threshold value used to densify the sampling network.</para>
        ///   <para>This parameter is only applicable when Standard error threshold, Lower quartile threshold, or Upper quartile threshold selection criteria is used.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>用于致密采样网络的阈值。</para>
        ///   <para>仅当使用标准误差阈值、下四分位数阈值或上四分位数阈值选择标准时，此参数才适用。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Threshold value")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _threshold { get; set; } = null;


        /// <summary>
        /// <para>Input weight raster</para>
        /// <para>A raster used to determine which locations to weight for preference.</para>
        /// <para>用于确定要对哪些位置进行优先权重的栅格。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input weight raster")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_weight_raster { get; set; } = null;


        /// <summary>
        /// <para>Input candidate point features</para>
        /// <para>Sample locations to pick from.</para>
        /// <para>可供选择的示例位置。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input candidate point features")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _in_candidate_point_features { get; set; } = null;


        /// <summary>
        /// <para>Inhibition distance</para>
        /// <para>Used to prevent any samples being placed within this distance from each other.</para>
        /// <para>用于防止任何样品被放置在此距离内。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Inhibition distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _inhibition_distance { get; set; } = null;


        public DensifySamplingNetwork SetEnv(object extent = null, object geographicTransformations = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(extent: extent, geographicTransformations: geographicTransformations, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}